package com.demo.webapp.kcfinder.model;

import java.util.ArrayList;
import java.util.List;

public class Folder implements java.io.Serializable {

	/**
	 * 版本序列化ID
	 */
	private static final long serialVersionUID = -3742105940005429268L;
	/** 
	 * 文件夹名
	 */
	private String name;
	
	/**
	 * 可读
	 */
	private boolean readable;
	
	/**
	 * 可写
	 */
	private boolean writable;
	
	/**
	 * 可移除
	 */
	private boolean removable;
	
	/**
	 * 当前是否选中
	 */
	private boolean current;
	
	/**
	 * 有子文件夹
	 */
	private boolean hasDirs;
	
	/**
	 * 子文件夹
	 */
	private List<Folder> dirs = new ArrayList<Folder>();
	
	/**
	 * 文件
	 */
	private List<File> files = new ArrayList<File>();

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean isReadable() {
		return readable;
	}

	public void setReadable(boolean readable) {
		this.readable = readable;
	}

	public boolean isWritable() {
		return writable;
	}

	public void setWritable(boolean writable) {
		this.writable = writable;
	}

	public boolean isRemovable() {
		return removable;
	}

	public void setRemovable(boolean removable) {
		this.removable = removable;
	}

	public boolean isCurrent() {
		return current;
	}

	public void setCurrent(boolean current) {
		this.current = current;
	}

	public boolean isHasDirs() {
		return hasDirs;
	}

	public void setHasDirs(boolean hasDirs) {
		this.hasDirs = hasDirs;
	}

	public List<Folder> getDirs() {
		return dirs;
	}

	public void setDirs(List<Folder> dirs) {
		this.dirs = dirs;
	}

	public List<File> getFiles() {
		return files;
	}

	public void setFiles(List<File> files) {
		this.files = files;
	}
	
	public void addFolder(Folder folder) {
		if (dirs == null) {
			dirs = new ArrayList<Folder>();
		}
		this.dirs.add(folder);
	}
}
